package com.wangyadong.hobby.schedule.jobtask.dsa;

import java.util.Iterator;
import java.util.Stack;

class CQueue {

    private Stack<Integer> stackTail;
    private Stack<Integer> stackhead;

    public CQueue() {
        //在此处写入代码
        stackTail = new Stack();
        stackhead = new Stack();
    }

    public void appendTail(int value) {
        //在此处写入代码
        stackTail.push(value);
    }

    public int deleteHead() {
        if (stackhead.isEmpty()) {
            while (!stackTail.isEmpty()) {
                stackhead.push(stackTail.pop());
            }
        }
        return stackhead.pop();
    }

    public static void main(String[] args) {
        CQueue cQueue = new CQueue();
        cQueue.appendTail(11);
        cQueue.appendTail(10);
        System.out.println(cQueue);
    }
}